/*
	Speed.h
*/

#ifndef Speed_h
#define Speed_h

#include "arduino.h"

#define MOVE_FORWARD 1
#define MOVE_BACKWARD 0;

enum MoverDire {FORWARD = 1, BACKWARD = 0};
enum DriveRange {LEFT = 1, RIGHT = 0, LR = 3};

class Speed
{
  public:
	Speed();
	Speed(int pinA, int pinAIA, int pinAIB, int pinB, int pinBIA, int pinBIB);

	void setLeftSpeed(int speed);
	int getLeftSpeed();

	void setRightSpeed(int speed);
	int getRightSpeed();

	void setSpeed(int speed);
	void setSpeed(DriveRange dr, int speed);

	
	void setLeftDire(MoverDire dire);
	void setRightDire(MoverDire dire);
	MoverDire getLeftDire();
	MoverDire getRightDire();
	void setDire(MoverDire dire);
	void setDire(DriveRange dr, MoverDire dire);

	void stopLeft();
	void stopRight();
	void stop();
	void stop(DriveRange dr);
  private:
	int leftPinIA, leftPinIB;
	int leftSpeedPin;

	int rightPinIA, rightPinIB;
	int rightSpeedPin;


	int leftSpeed, rightSpeed;
	MoverDire leftDire, rightDire;

	void init();
};

#endif

